#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include <stdio.h>
using namespace std;


int main()
{
    map<int , vector<int> > delay;
    vector<int> node;

    node.push_back(1);
    node.push_back(2);
    node.push_back(3);
    node.push_back(4);
    delay.insert(make_pair(1, node));
    node.clear();
    node.push_back(1);
    node.push_back(22);
    node.push_back(3);
    node.push_back(4);
    node.push_back(1);
    delay.insert(make_pair(2, node));
    for (map<int, vector<int> >::iterator it = delay.begin(); it != delay.end(); it++)
    {
        reverse((*it).second.begin(),(*it).second.end());
         for(int i = 0; i <(*it).second.size();i++)
         {
             cout << (*it).second[i] ;
         }
         cout << endl;
    }
    return 0;
}